import React, { Component } from 'react';
import autoBind from 'react-autobind';
import { connect } from 'dva';

import { getUserId } from '../utils/utils'

// widget 
import HeadNav from '../components/Common/HeadNav'
import DeliverWayBody from '../components/DeliverWay/DeliverWayBody'

class DeliverWayPage extends Component {
	constructor(props) {
        super(props)
        autoBind(this)
    }
    
    componentDidMount() {
    	const { dispatch, meyley } = this.props
    	dispatch({
    		type: 'address/fetchProvince',
            payload: getUserId()
    	})
    }

	render() {
		return (
		  	<div>
                <HeadNav title="选择配送方式" leftPath="/order" />
    			<DeliverWayBody {...this.props} />
		    </div>
		);
	}
}

DeliverWayPage.propTypes = {
};

export default connect(({ meyley, address }) => ({
	meyley,
    address
}))(DeliverWayPage);